let screenSaverDBus = null;
let screencastService = null;
let modalCount = 0;
-let keybindingMode = Shell.KeyBindingMode.NONE;
+let actionMode = Shell.ActionMode.NONE;
let modalActorFocusStack = [];
let uiGroup = null;
let magnifier = null;
_loadDefaultStylesheet();
wm.setCustomKeybindingHandler('panel-main-menu',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
sessionMode.hasOverview ? Lang.bind(overview, overview.toggle) : null);
- wm.allowKeybinding('overlay-key', Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW);
+ wm.allowKeybinding('overlay-key', Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW);
wm.setCustomKeybindingHandler('panel-run-dialog',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
sessionMode.hasRunDialog ? openRunDialog : null);
if (!sessionMode.hasRunDialog) {
}
layoutManager.connect('startup-complete', function() {
- if (keybindingMode == Shell.KeyBindingMode.NONE) {
- keybindingMode = Shell.KeyBindingMode.NORMAL;
+ if (actionMode == Shell.ActionMode.NONE) {
+ actionMode = Shell.ActionMode.NORMAL;
}
if (screenShield) {
screenShield.lockIfWasLocked();
* - options: Meta.ModalOptions flags to indicate that the pointer is
* already grabbed
*
- * - keybindingMode: used to set the current Shell.KeyBindingMode to filter
+ * - actionMode: used to set the current Shell.ActionMode to filter
* global keybindings; the default of NONE will filter
* out all keybindings
*
function pushModal(actor, params) {
params = Params.parse(params, { timestamp: global.get_current_time(),
options: 0,
- keybindingMode: Shell.KeyBindingMode.NONE });
+ actionMode: Shell.ActionMode.NONE });
if (modalCount == 0) {
if (!global.begin_modal(params.timestamp, params.options)) {
destroyId: actorDestroyId,
prevFocus: prevFocus,
prevFocusDestroyId: prevFocusDestroyId,
- keybindingMode: keybindingMode });
+ actionMode: actionMode });
- keybindingMode = params.keybindingMode;
+ actionMode = params.actionMode;
global.stage.set_key_focus(actor);
return true;
}
if (focusIndex < 0) {
global.stage.set_key_focus(null);
global.end_modal(timestamp);
- keybindingMode = Shell.KeyBindingMode.NORMAL;
+ actionMode = Shell.ActionMode.NORMAL;
throw new Error('incorrect pop');
}
if (focusIndex == modalActorFocusStack.length - 1) {
if (record.prevFocus)
record.prevFocus.disconnect(record.prevFocusDestroyId);
- keybindingMode = record.keybindingMode;
+ actionMode = record.actionMode;
global.stage.set_key_focus(record.prevFocus);
} else {
// If we have:
for (let i = modalActorFocusStack.length - 1; i > focusIndex; i--) {
modalActorFocusStack[i].prevFocus = modalActorFocusStack[i - 1].prevFocus;
modalActorFocusStack[i].prevFocusDestroyId = modalActorFocusStack[i - 1].prevFocusDestroyId;
- modalActorFocusStack[i].keybindingMode = modalActorFocusStack[i - 1].keybindingMode;
+ modalActorFocusStack[i].actionMode = modalActorFocusStack[i - 1].actionMode;
}
}
modalActorFocusStack.splice(focusIndex, 1);
layoutManager.modalEnded();
global.end_modal(timestamp);
Meta.enable_unredirect_for_screen(global.screen);
- keybindingMode = Shell.KeyBindingMode.NORMAL;
+ actionMode = Shell.ActionMode.NORMAL;
}
function createLookingGlass() {
},
vfunc_gesture_prepare : function(action, actor) {
- let allowedModes = Shell.KeyBindingMode.NORMAL | Shell.KeyBindingMode.OVERVIEW;
+ let allowedModes = Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW;
return this.get_n_current_points() == this.get_n_touch_points() &&
- (allowedModes & Main.keybindingMode);
+ (allowedModes & Main.actionMode);
},
vfunc_gesture_end : function(action, actor) {
},
vfunc_gesture_prepare : function(action, actor) {
- if (Main.keybindingMode != Shell.KeyBindingMode.NORMAL) {
+ if (Main.actionMode != Shell.ActionMode.NORMAL) {
this.cancel();
return false;
}
this._tilePreview = null;
this.setCustomKeybindingHandler('switch-to-workspace-left',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-to-workspace-right',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-to-workspace-up',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-to-workspace-down',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-to-workspace-last',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-left',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-right',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-up',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-down',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-to-workspace-1',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-to-workspace-2',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-to-workspace-3',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-to-workspace-4',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-to-workspace-5',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-to-workspace-6',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-to-workspace-7',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-to-workspace-8',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-to-workspace-9',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-to-workspace-10',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-to-workspace-11',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-to-workspace-12',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-1',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-2',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-3',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-4',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-5',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-6',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-7',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-8',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-9',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-10',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-11',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-12',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('move-to-workspace-last',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._showWorkspaceSwitcher));
this.setCustomKeybindingHandler('switch-applications',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._startAppSwitcher));
this.setCustomKeybindingHandler('switch-group',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._startAppSwitcher));
this.setCustomKeybindingHandler('switch-applications-backward',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._startAppSwitcher));
this.setCustomKeybindingHandler('switch-group-backward',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._startAppSwitcher));
this.setCustomKeybindingHandler('switch-windows',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._startWindowSwitcher));
this.setCustomKeybindingHandler('switch-windows-backward',
- Shell.KeyBindingMode.NORMAL,
+ Shell.ActionMode.NORMAL,
Lang.bind(this, this._startWindowSwitcher));
this.setCustomKeybindingHandler('switch-panels',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW |
- Shell.KeyBindingMode.LOCK_SCREEN |
- Shell.KeyBindingMode.UNLOCK_SCREEN |
- Shell.KeyBindingMode.LOGIN_SCREEN,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW |
+ Shell.ActionMode.LOCK_SCREEN |
+ Shell.ActionMode.UNLOCK_SCREEN |
+ Shell.ActionMode.LOGIN_SCREEN,
Lang.bind(this, this._startA11ySwitcher));
this.setCustomKeybindingHandler('switch-panels-backward',
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.OVERVIEW |
- Shell.KeyBindingMode.LOCK_SCREEN |
- Shell.KeyBindingMode.UNLOCK_SCREEN |
- Shell.KeyBindingMode.LOGIN_SCREEN,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.OVERVIEW |
+ Shell.ActionMode.LOCK_SCREEN |
+ Shell.ActionMode.UNLOCK_SCREEN |
+ Shell.ActionMode.LOGIN_SCREEN,
Lang.bind(this, this._startA11ySwitcher));
this.addKeybinding('pause-resume-tweens',
new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
Meta.KeyBindingFlags.NONE,
- Shell.KeyBindingMode.ALL,
+ Shell.ActionMode.ALL,
Lang.bind(this, this._toggleTweens));
this.addKeybinding('open-application-menu',
new Gio.Settings({ schema_id: SHELL_KEYBINDINGS_SCHEMA }),
Meta.KeyBindingFlags.NONE,
- Shell.KeyBindingMode.NORMAL |
- Shell.KeyBindingMode.TOPBAR_POPUP,
+ Shell.ActionMode.NORMAL |
+ Shell.ActionMode.TOPBAR_POPUP,
Lang.bind(this, this._toggleAppMenu));
Main.overview.connect('showing', Lang.bind(this, function() {
removeKeybinding: function(name) {
if (global.display.remove_keybinding(name))
- this.allowKeybinding(name, Shell.KeyBindingMode.NONE);
+ this.allowKeybinding(name, Shell.ActionMode.NONE);
},
allowKeybinding: function(name, modes) {
},
_filterKeybinding: function(shellwm, binding) {
- if (Main.keybindingMode == Shell.KeyBindingMode.NONE)
+ if (Main.actionMode == Shell.ActionMode.NONE)
return true;
// There's little sense in implementing a keybinding in mutter and
// not having it work in NORMAL mode; handle this case generically
// so we don't have to explicitly allow all builtin keybindings in
// NORMAL mode.
- if (Main.keybindingMode == Shell.KeyBindingMode.NORMAL &&
+ if (Main.actionMode == Shell.ActionMode.NORMAL &&
binding.is_builtin())
return false;
- return !(this._allowedKeybindings[binding.get_name()] & Main.keybindingMode);
+ return !(this._allowedKeybindings[binding.get_name()] & Main.actionMode);
},
_switchWorkspace : function(shellwm, from, to, direction) {